import React from 'react';
import {
  Form,
  Modal,
  Tooltip,
} from 'antd';

import DescriptionList from '@/components/DescriptionList';

const { Description } = DescriptionList;
import styles from '../UserManage.less';

// 查看详情
const DescView = Form.create()(props => {
  const { lookDescView, handleLookDesc, selectedRows } = props;
  return (
    <Modal
      width={640}
      destroyOnClose
      title="查看商户信息"
      visible={lookDescView}
      onOk={() => handleLookDesc(false,[])}
      onCancel={() => handleLookDesc(false, [])}>
      <DescriptionList size="large" style={{ marginBottom: 32 }} col="2">
        <Description term="商户编号">{selectedRows.merchantNo}</Description>
        <Description term="商户名称">{selectedRows.merchantName}</Description>
        <Description term="品牌编号">{selectedRows.brandNo}</Description>
        <Description term="品牌名称">{selectedRows.brandName}</Description>
        <Description term="企业编号">{selectedRows.enterpriseNo}</Description>
        <Description term="企业名称">{selectedRows.enterpriseName}</Description>
        <Description term="状态">{selectedRows.status === 1 ? '启用' : '停用'}</Description>
        <Description term="描述">{<a target={'_blank'} href={selectedRows.remark}>
          <img className={styles.brandLogo} src={selectedRows.remark}
               alt=""/></a>}</Description>
        <Description term="创建人">{selectedRows.createName}</Description>
        <Description term="创建时间">{selectedRows.createTime}</Description>
        <Description term="商户icon">{<a target={'_blank'} href={selectedRows.merchantIcon}>
          <img className={styles.brandLogo} src={selectedRows.merchantIcon}
               alt=""/></a>}</Description>
      </DescriptionList>
      <Description term="法大大标识">
        <Tooltip placement="top" title={selectedRows.caNo}>
          {selectedRows.caNo}
        </Tooltip>
      </Description>
    </Modal>
  );
});

export default DescView;
